using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using Accurint;

namespace Accurint.Test {
	/// <summary>
	/// Summary description for Form1.
	/// </summary>
	public class TestForm : System.Windows.Forms.Form {
		private System.Windows.Forms.Button btnLogIn;
		private System.Windows.Forms.Button btnSearch;
		private System.Windows.Forms.TextBox txtMsg;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public TestForm() {
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing ) {
			if( disposing ) {
				if (components != null) {
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent() {
			this.btnLogIn = new System.Windows.Forms.Button();
			this.btnSearch = new System.Windows.Forms.Button();
			this.txtMsg = new System.Windows.Forms.TextBox();
			this.SuspendLayout();
			// 
			// btnLogIn
			// 
			this.btnLogIn.Location = new System.Drawing.Point(0, 0);
			this.btnLogIn.Name = "btnLogIn";
			this.btnLogIn.TabIndex = 0;
			this.btnLogIn.Text = "LogIn";
			this.btnLogIn.Click += new System.EventHandler(this.btnLogIn_Click);
			// 
			// btnSearch
			// 
			this.btnSearch.Location = new System.Drawing.Point(88, 0);
			this.btnSearch.Name = "btnSearch";
			this.btnSearch.TabIndex = 0;
			this.btnSearch.Text = "Search";
			this.btnSearch.Click += new System.EventHandler(this.btnSearch_Click);
			// 
			// txtMsg
			// 
			this.txtMsg.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
				| System.Windows.Forms.AnchorStyles.Left) 
				| System.Windows.Forms.AnchorStyles.Right)));
			this.txtMsg.Location = new System.Drawing.Point(0, 28);
			this.txtMsg.Multiline = true;
			this.txtMsg.Name = "txtMsg";
			this.txtMsg.Size = new System.Drawing.Size(292, 244);
			this.txtMsg.TabIndex = 1;
			this.txtMsg.Text = "";
			// 
			// TestForm
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(292, 272);
			this.Controls.Add(this.txtMsg);
			this.Controls.Add(this.btnLogIn);
			this.Controls.Add(this.btnSearch);
			this.Name = "TestForm";
			this.Text = "Form1";
			this.ResumeLayout(false);

		}
		#endregion

		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static void Main() {
			Application.Run(new TestForm());
		}

		private void btnLogIn_Click(object sender, System.EventArgs e) {
			new Client().Login();
		}

		private void btnSearch_Click(object sender, System.EventArgs e) {
			//try{
				txtMsg.Text = new Client().GoPeopleSearch("358704124").GetXml();
			//}catch(Exception exc){
			//	txtMsg.Text += exc.Message + Environment.NewLine;
			//}
		}
	}
}
